description = "Testcontainers :: BOM"

publishing {
    publications {
        mavenJava(MavenPublication) { publication ->
            artifactId = "testcontainers-bom"
            artifacts = []

            pom.withXml {
                def dependencyManagementNode = asNode().appendNode('dependencyManagement').appendNode('dependencies')

                def bomProject = project
                rootProject.subprojects.each { subProject ->
                    if (subProject != bomProject && subProject.plugins.findPlugin("maven-publish")) {
                        dependencyManagementNode.appendNode('dependency').with {
                            appendNode('groupId', subProject.group)
                            appendNode('artifactId',subProject.name)
                            appendNode('version', subProject.version)
                        }
                    }
                }
            }
        }
    }
}
